using GTA;
using GTA.Native;

namespace CustomPeds;

public static class SkinHelper
{
    public static void SetPedComponentVariation(Ped ped, int componentId, int drawableId, int textureId, int paletteId)
    {
        Function.Call<int>((Hash)0x262B14F48D29DE80ul, ped, componentId, drawableId, textureId, paletteId);
    }

    public static int GetPedDrawableVariation(Ped ped, int componentId)
    {
        return Function.Call<int>((Hash)0x67F3780DD425D4FCul, ped, componentId);
    }

    public static int GetPedTextureVariation(Ped ped, int componentId)
    {
        return Function.Call<int>((Hash)0x04A355E041E004E6ul, ped, componentId);
    }

    public static int GetPedPaletteVariation(Ped ped, int componentId)
    {
        return Function.Call<int>((Hash)0xE3DD5F2A84B42281ul, ped, componentId);
    }

    public static int GetPedDrawableNumber(Ped ped, int componentId)
    {
        return Function.Call<int>((Hash)0x27561561732A7842ul, ped, componentId);
    }

    public static int GetPedTextureNumber(Ped ped, int componentId, int drawableId)
    {
        return Function.Call<int>((Hash)0x8F7156A3142A6BADul, ped, componentId, drawableId);
    }

    public static void SetPedPropIndex(Ped ped, int propId, int drawableId, int textureId, bool attach)
    {
        Function.Call<int>((Hash)0x93376B65A266EB5Ful, ped, propId, drawableId, textureId, attach);
    }

    public static int GetPedPropIndex(Ped ped, int propId)
    {
        return Function.Call<int>((Hash)0x898CC20EA75BACD8ul, ped, propId);
    }

    public static int GetPedPropTextureIndex(Ped ped, int propId)
    {
        return Function.Call<int>((Hash)0xE131A28626F81AB2ul, ped, propId);
    }

    public static int GetPedPropDrawableNumber(Ped ped, int propId)
    {
        return Function.Call<int>((Hash)0x5FAF9754E789FB47ul, ped, propId);
    }

    public static int GetPedPropTextureNumber(Ped ped, int propId, int drawableId)
    {
        return Function.Call<int>((Hash)0xA6E7F1CEB523E171ul, ped, propId, drawableId);
    }

    public static void ClearPedProp(Ped ped, int propId)
    {
        Function.Call((Hash)0x0943E5B8E078E76Eul, ped, propId);
    }

    public static void ClearAllPedProps(Ped ped)
    {
        Function.Call((Hash)0xCD8A7537A9B52F06ul, ped);
    }

    public static void SetPedHeadBlendData(Ped ped, int shapeFirstID, int shapeSecondID, int shapeThirdID, int skinFirstID, int skinSecondID, int skinThirdID, float shapeMix, float skinMix, float thirdMix, bool isParent)
    {
        Function.Call((Hash)0x9414E18B9434C2FEul, ped, shapeFirstID, shapeSecondID, shapeThirdID, skinFirstID, skinSecondID, skinThirdID, shapeMix, skinMix, thirdMix, isParent);
    }

    public static void UpdatePedHeadBlendData(Ped ped, float shapeMix, float skinMix, float thirdMix)
    {
        Function.Call((Hash)0x723538F61C647C5Aul, ped, shapeMix, skinMix, thirdMix);
    }

    public static int GetFirstParentIdForPedType(int type)
    {
        return Function.Call<int>((Hash)0x68D353AB88B97E0Cul, type);
    }

    public static int GetNumParentPedsOfType(int type)
    {
        return Function.Call<int>((Hash)0x5EF37013A6539C9Dul, type);
    }

    public static bool HasPedHeadBlend(Ped ped)
    {
        return Function.Call<bool>((Hash)0x654CD0A825161131ul, ped);
    }

    public static void SetPedFaceFeature(Ped ped, int index, float scale)
    {
        Function.Call((Hash)0x71A5C1DBA060049Eul, ped, index, scale);
    }

    public static void SetPedEyeColor(Ped ped, int colorID)
    {
        Function.Call((Hash)0x50B56988B170AFDFul, ped, colorID);
    }

    public static void SetPedHairColor(Ped ped, int colorID, int highlightColorID)
    {
        Function.Call((Hash)0x4CFFC65454C93A49ul, ped, colorID, highlightColorID);
    }

    public static int GetNumHairColors(Ped ped)
    {
        return Function.Call<int>((Hash)0xE5C0CF872C2AD150ul, ped);
    }

    public static int GetNumMakeupColors(Ped ped)
    {
        return Function.Call<int>((Hash)0xD1F7CA1535D22818ul, ped);
    }

    public static void SetPedHeadOverlayValue(Ped ped, int overlayID, int overlayValue, float opacity)
    {
        Function.Call((Hash)0x48F44967FA05CC1Eul, ped, overlayID, overlayValue, opacity);
    }

    public static void SetPedHeadOverlayColor(Ped ped, int overlayID, int colorType, int firstColorID, int secondColorID)
    {
        Function.Call((Hash)0x497BF74A7B9CB952ul, ped, overlayID, colorType, firstColorID, secondColorID);
    }

    public static int GetPedHeadOverlayValue(Ped ped, int overlayID)
    {
        return Function.Call<int>((Hash)0xA60EF3B6461A4D43ul, ped, overlayID);
    }

    public static int GetNumHeadOverlayValue(int overlayID)
    {
        return Function.Call<int>((Hash)0xCF1CE768BB43480Eul, overlayID);
    }

    public static void SetPedDecoration(Ped ped, string collection, string overlay)
    {
        var collectionHash = StringHash.AtStringHashUtf8(collection);
        var overlayHash = StringHash.AtStringHashUtf8(overlay);
        Function.Call((Hash)0x5F5D1665E352A839ul, ped, collectionHash, overlayHash);
    }

    public static void ClearPedDecorations(Ped ped)
    {
        Function.Call((Hash)0x0E5173C163976E38ul, ped);
    }

    public static void SetDefaultClothes(this Ped ped)
    {
        Function.Call((Hash)0x45EEE61580806D63ul, ped);
    }
}


